Skip to content

Add doc strings for common bundle resource fields#5664

Merged
radakam merged 5 commits into
mainfrom
deco-2769-add-doc-strings-for-common-resource-fields
Jun 23, 2026
Merged

Add doc strings for common bundle resource fields#5664
radakam merged 5 commits into
mainfrom
deco-2769-add-doc-strings-for-common-resource-fields

Conversation

@radakam

@radakam radakam commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Changes

Document the common fields DABs injects across resources in the bundle JSON schema, which previously rendered empty tooltips/docs on many resources. The wording is aligned with the official Databricks docs (bundle permissions, Unity Catalog manage-privileges, and UC permissions concepts):

  • permissions — fill the 8 SDK-typed variants' item subfields (level, user_name, service_principal_name, group_name) and add a field-level description + markdown_description + example on all resources. The description notes that each item grants one level to a single user/group/service principal, and that a principal cannot appear in both a resource's permissions and the top-level permissions mapping. level clarifies that the allowed values depend on the resource type.
  • lifecycle — propagate the existing field-level description to the resources where it was still a placeholder.
  • grants — add a field-level description + markdown_description + example on the UC resources (subfields come from the SDK), matching the resources reference wording and linking to the UC manage-privileges docs.

Regenerated bundle/schema/jsonschema.json and the pydabs Python bindings (python/databricks/bundles/**) so the generated artifacts stay in sync.

Why

These are the cross-cutting fields DABs owns on every resource, but their docs were only partially filled, so editor completions and the docs site showed blanks inconsistently. The remaining schema placeholders are resource-specific API fields whose descriptions belong upstream in the OpenAPI spec, not as CLI-only overrides, so they are intentionally left out.

Tests

Docs-only/schema change. go test ./bundle/internal/schema/... passes, which verifies regeneration from the committed annotations is a no-op (no stale or missing placeholders). validate-generated passes now that the pydabs bindings are regenerated.

@radakam radakam temporarily deployed to test-trigger-is June 19, 2026 14:09 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 19, 2026 14:09 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6122f06

Run: 28017233303

Env 🟨​KNOWN ✅​pass 🙈​skip Time
🟨​ aws linux 1 216 99 3:11
🟨​ aws windows 1 218 97 2:46
🟨​ aws-ucws linux 1 297 18 3:29
🟨​ aws-ucws windows 1 299 16 4:16
🟨​ azure linux 1 216 98 3:08
🟨​ azure windows 1 218 96 2:33
🟨​ azure-ucws linux 1 299 15 3:58
🟨​ azure-ucws windows 1 301 13 3:22
🟨​ gcp linux 1 215 100 2:53
🟨​ gcp windows 1 217 98 2:24
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K

@radakam radakam temporarily deployed to test-trigger-is June 22, 2026 06:06 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 22, 2026 06:06 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 08:02 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 08:02 — with GitHub Actions Inactive
radakam added 3 commits June 23, 2026 08:18
Document the common fields DABs injects across resources in the bundle
JSON schema: permissions, lifecycle, and grants. These previously showed
empty tooltips/docs on many resources.

- permissions: fill the 8 SDK-typed variants' item subfields (level,
  user_name, service_principal_name, group_name) and add a field-level
  description, markdown_description, and example on all resources.
- lifecycle: propagate the existing field-level description to the
  resources where it was still a placeholder.
- grants: add a field-level description, markdown_description, and
  example on the UC resources (subfields come from the SDK).

Regenerated bundle/schema/jsonschema.json.
The annotations.yml/jsonschema.json doc string additions for permissions,
lifecycle, and grants were not propagated to the generated pydabs models,
so validate-generated failed. Ran pydabs-codegen to sync them.
Align the permissions, grants, and permission-subfield doc strings with the
Databricks docs (bundle permissions, Unity Catalog manage-privileges and
permissions-concepts):

- level: clarify the allowed levels depend on the resource type.
- permissions: describe that each item grants one level to a single
  user/group/service principal and note the no-overlap rule with the
  top-level permissions mapping.
- grants: match the resources reference wording and link to the Unity
  Catalog manage-privileges docs.
- group/user/service_principal_name: use the docs' "granted" phrasing.

Regenerated jsonschema.json and pydabs bindings.
@radakam radakam marked this pull request as ready for review June 23, 2026 08:20
@radakam radakam requested a review from shreyas-goenka June 23, 2026 08:21
@radakam radakam force-pushed the deco-2769-add-doc-strings-for-common-resource-fields branch from fe1e312 to 37df68d Compare June 23, 2026 08:23
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 08:24 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 08:24 — with GitHub Actions Inactive
Comment thread bundle/internal/schema/annotations.yml Outdated
"lifecycle":
"description": |-
PLACEHOLDER
Lifecycle is a struct that contains the lifecycle settings for a resource. It controls the behavior of the resource when it is deployed or destroyed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @andrewnester @juliacrawf-db

Can omit "struct" (user's don't care). Also "the behavior of the resource" is vague and doesn't capture everything. This sentence should be refined.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed." here and in other cases. Please let me know if some other wording is better!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! If there is additional copy editing needed it can be done in a follow up PR.

"markdown_description": |-
A Sequence of permissions to apply to this resource, where each item grants a permission `level` to a single `user_name`, `group_name`, or `service_principal_name`. A principal cannot be set in both a resource's `permissions` and the top-level `permissions` mapping.

See [\_](/dev-tools/bundles/settings.md#permissions) and [\_](/dev-tools/bundles/permissions.md).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These links resolve on the docs site but not in JSON schema right?

Is there precedence for including such links?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this follows an existing pattern in annotations.yml, for example, line 310 in this file. I used the same convention here for consistency, but would be happy to remove them if it makes more sense!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for clarifying.

Drop the implementation-detail "struct" wording and the vague "controls
the behavior" phrasing in favor of describing the actual behavior.
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 09:26 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 09:26 — with GitHub Actions Inactive
The previous commit refined the lifecycle field description in
annotations.yml and jsonschema.json but did not regenerate the Python
bindings, causing the validate-generated CI check to fail.
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 09:43 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 23, 2026 09:43 — with GitHub Actions Inactive
Comment thread bundle/internal/schema/annotations.yml Outdated
"lifecycle":
"description": |-
PLACEHOLDER
Lifecycle is a struct that contains the lifecycle settings for a resource. It controls the behavior of the resource when it is deployed or destroyed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! If there is additional copy editing needed it can be done in a follow up PR.

"markdown_description": |-
A Sequence of permissions to apply to this resource, where each item grants a permission `level` to a single `user_name`, `group_name`, or `service_principal_name`. A principal cannot be set in both a resource's `permissions` and the top-level `permissions` mapping.

See [\_](/dev-tools/bundles/settings.md#permissions) and [\_](/dev-tools/bundles/permissions.md).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for clarifying.

@radakam radakam enabled auto-merge June 23, 2026 09:47
@radakam radakam added this pull request to the merge queue Jun 23, 2026
Merged via the queue into main with commit aca6164 Jun 23, 2026
31 checks passed
@radakam radakam deleted the deco-2769-add-doc-strings-for-common-resource-fields branch June 23, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants